data "aws_vpc" "main" {
  filter {
    name   = "tag:Name"
    values = ["app2"]  # 使用与创建 VPC 相同的名称查找
  }
}

data "aws_subnets" "main" {
  filter {
    name   = "vpc-id"
    values = [data.aws_vpc.main.id]  # 使用查找到的 VPC ID
  }
}

module "igw-tt2" {
  igw_name    = "tt2"
  source      = "../../modules/igw"
  vpc_id          = data.aws_vpc.main.id
  subnet_ids      = data.aws_subnets.main.ids
}
